<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/base.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/style.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/swiper.min.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/ydui.css" />
    <title>半岛云</title>  
</head>
<body>
    <input type="hidden" id="active" value="sc">
    <!--标题栏-->
	<div class="fixed_top">
		<div class="top-l"><a href="javascript:window.history.back()"><i class="icons">&#xe626;</i></a></div>
		<h2>${product.productName!''}</h1>
	</div>
	<div class="wrap margintop44" style="padding-bottom:60px">
	        <img src="${product.productCover!''}"/>
			<div class="infomation">
				<!-- <h3></h3> -->
				<div class="details">
					${product.productSynopsis!''}
				</div>
			</div>   
		    <div class="">
				<div class="foot_l"><p>售价:<span class="red">￥${product.productPrice!''}</span></p></div>
				<div class="foot_r"><a href="javascript:;" class="jrgwc"  data-id="${product.id!''}">加入购物车</a><a href="shopcar.html" class="ljgm">立即购买</a></div>
			</div>
	</div>
	
	
			
		<!--导航栏-->
        <#include "/common/foot.html">
</body>
<script src="https://cdn.bootcss.com/eruda/1.4.4/eruda.min.js"></script>
<script type="text/javascript" src="/${BasePath}/static/mobile/js/ydui.flexible.js"></script>
<script type="text/javascript" src="/${BasePath}/static/mobile/js/ydui.js"></script>
<script type="text/javascript">
    $(function(){
	    /*加入购物车*/
	    $(".jrgwc").click(function(){
	        $.ajax({
	            type: 'post',
	            url: "/${BasePath}/shops/addCart",
	            data: {"productId":$(this).attr('data-id')},
	            dataType: 'json',
	            error:function (XMLHttpRequest, textStatus, errorThrown) {
	            	var html =XMLHttpRequest.responseText;
	            	if(html.indexOf("登录")!=-1){
	                	/* 调用2： */
	                	YDUI.dialog.alert('您还未登录，前去登录！', function(){
	                		window.location.href="/${BasePath}/user/login"
	                	});
	            	}else{
	            		YDUI.dialog.alert('操作失败，请稍后再试！');
	            	}
	            },
	            success: function(data){
	                if (data.code == "1"){
	                	/* 调用1(带时间)： */
	                	YDUI.dialog.toast(data.msg, 'success', 2000, function () {
	                	    /* 关闭后调用 */
	                	});
	                }else{
	    				$("#nextBtn").attr('disabled',false);
	    				$("#nextBtn").html("登录");
	                	changeImg();
	                	zz1(data.msg);
	                }
	            }
	        });	    	
	    })
	})
</script>
</html>